Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional style formatter. Color range is all float numb… #34001

Merged
merged 3 commits into from
Sep 9, 2017

Conversation

rebornix
Copy link
Member

@rebornix rebornix commented Sep 8, 2017

Fix #32235.

Per discussion points in #32235

  • Color value ranges. Now we only expose float number between 0...1 .
  • Color.fromHex, Color.fromHSL are removed from the API.
  • Color Insertion. This is not done, but it's not a blocker to the API finalization.

With the new API,

  • The title of Color Picker only shows four color format, RGB, HEX, HSL, HSA, which are representatives of RGB color model. When users click on it, we iterate through them.
  • When users move the cursor inside the saturation box, we only make updates to the document when mouse up.
  • Since we only make changes when the color is finalized (mouse up), we ask the provider for string representative of selected color. We don't flood the extensions of both API call or content change.
  • Extensions format the color per Color Format users select in the color picker.

For now, the four formats are good enough as long as we are only targeting RGB color model. If there is other feature request, we need to update both provideColorRange and resolveColor as the color can no longer be represented as RGB. cc @joaomoreno @jrieken

@rebornix rebornix self-assigned this Sep 8, 2017
@rebornix rebornix force-pushed the ColorPickerFormatter branch from de6994c to f0ecb26 Compare September 8, 2017 18:36
@rebornix
Copy link
Member Author

rebornix commented Sep 9, 2017

Aligned the API name with other providers, now it works the same way as before and our API surface is based on RGB color model. Extensions do the parsing and resolving.

@rebornix rebornix merged commit 3481343 into microsoft:master Sep 9, 2017
@joaomoreno
Copy link
Member

Good job!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color Picker: Finalize Color Picker API
3 participants